import os,sys,re 
from   PyQt6.QtWidgets import *
from   PyQt6.QtCore import  Qt,QDateTime
from   PyQt6.QtGui  import QBrush,QPen,QColor
import sys,random
import QCustomPlot_PyQt6
from   QCustomPlot_PyQt6 import QCustomPlot,QCP,QCPAxisRect,QCPAxis,QCPGraph


class QCustomPlotDemo(QWidget):
    def __init__(self):
        super(QCustomPlotDemo, self).__init__()
        self.resize(600,600)
        self.setWindowTitle("123")
        self.layout = QVBoxLayout(self)
        self.m_plot = QCustomPlot()
        self.layout.addWidget(self.m_plot)
        self.x = [ i for i in range(20)]
        self.y = [random.randint(0,20) for i in range(20)]

        self.m_plot.addGraph()
        self.pen = QPen()
        #self.pen.setStyle(Qt.DotLine)
        self.pen.setWidth(2)
        self.pen.setColor(QColor(255,0,0))
        self.m_plot.graph(0).setPen(self.pen)
        #self.m_plot.graph(0).setLineStyle(QCPGraph.lsLine)
        #self.m_plot.graph(0).setBrush(QBrush(QColor(0, 0, 255, 20)))
        self.m_plot.graph(0).setData(self.x, self.y)
        self.m_plot.xAxis.setVisible(True)
        self.m_plot.yAxis.setVisible(True)
        self.m_plot.xAxis.setLabel("x")
        self.m_plot.yAxis.setLabel("y")
        self.m_plot.xAxis.setRange(0,20)
        self.m_plot.yAxis.setRange(0,20)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    test = QCustomPlotDemo()
    test.show()
    sys.exit(app.exec())